<?php
require_once(dirname(__FILE__)."/nusoap/lib/nusoap.php");
require_once(dirname(__FILE__)."/../apiclass/common.php");

//用户登陆
function login($userid,$password){
	return login1($userid,$password);
}
//用户注册
function reg($userid,$password,$email){
	return reg1($userid,$password,$email);
}
//获取用户详细信息
function getmeminfo($userno,$password){
	return getmeminfo1($userno,$password);
}
//修改密码
function editpass($userno,$password,$newpassword){
	
	return editpass1($userno,$password,$newpassword);
}
//修改头像
function editpic($userno,$password,$pic){
 return editpic1($userno,$password,$pic);
}
function memedit($userno,$password,$sex,$email,$tel,$shenfen,$chengshi,$qu,$shengri,$aihao,$jianjie,$qianming,$nianji,$school){
	return memedit1($userno,$password,$sex,$email,$tel,$shenfen,$chengshi,$qu,$shengri,$aihao,$jianjie,$qianming,$nianji,$school);
	
	
}

//获取地区
function getareas($cataid){
	return getareas1($cataid);
}
//获得资源列表
function  getcontent($keyword,$item,$cataid,$price_free,$nianji,$xueke,$xueduan,$xueqi,$banben,$zhuti,$shengfen,$order,$sj,$pagesize,$page)
{
	

	return  getcontent1($keyword,$item,$cataid,$price_free,$nianji,$xueke,$xueduan,$xueqi,$banben,$zhuti,$shengfen,$order,$sj,$pagesize,$page);
}

//获得资源详细
function getshow($id){
return getshow1($id);
}
//获得下载地址
function getfile($userno,$password,$codeid){
	return getfile1($userno,$password,$codeid);
}
//购买资源
function saveorder($userno,$password,$codeid){
	return saveorder1($userno,$password,$codeid);
}

//获取类别
function getclass($cataid,$nianji,$xueke,$xueduan,$xueqi,$banben,$zhuti,$shengfen){
	return getclass1($cataid,$nianji,$xueke,$xueduan,$xueqi,$banben,$zhuti,$shengfen);
}

//获得年级
function getnianji_class($cataid,$xueke,$xueduan,$xueqi,$banben,$zhuti,$shengfen){
	return getnianji_class1($cataid,$xueke,$xueduan,$xueqi,$banben,$zhuti,$shengfen);
}

//获得学科
function getxueke_class($cataid,$nianji,$xueduan,$xueqi,$banben,$zhuti,$shengfen){
	return getxueke_class1($cataid,$nianji,$xueduan,$xueqi,$banben,$zhuti,$shengfen);
}
//获得学段
function getxueduan_class($cataid,$nianji,$xueke,$xueqi,$banben,$zhuti,$shengfen){
	return getxueduan_class1($cataid,$nianji,$xueke,$xueqi,$banben,$zhuti,$shengfen);
}
//获得学期
function getxueqi_class($cataid,$nianji,$xueke,$xueduan,$banben,$zhuti,$shengfen){
	return getxueqi_class1($cataid,$nianji,$xueke,$xueduan,$banben,$zhuti,$shengfen);
}

//获得版本
function getbanben_class($cataid,$nianji,$xueke,$xueduan,$xueqi,$zhuti,$shengfen){
	return getbanben_class1($cataid,$nianji,$xueke,$xueduan,$xueqi,$zhuti,$shengfen);
}

//获得主题
function getzhuti_class($cataid,$nianji,$xueke,$xueduan,$xueqi,$banben,$shengfen){
	return getzhuti_class1($cataid,$nianji,$xueke,$xueduan,$xueqi,$banben,$shengfen);
}

//获得省份
function getshengfen($cataid,$nianji,$xueke,$xueduan,$xueqi,$banben,$zhuti){
	return getshengfen1($cataid,$nianji,$xueke,$xueduan,$xueqi,$banben,$zhuti);
}

//获取类别(不包括资源总数)
function getcata($cataid){
	return getcata1($cataid);
}
//获得那年级
function getnj_class(){
	return getnj_class1();
}
//获得学科
function getxk_class(){
	return getxk_class1();
}
//获得学段
function getxd_class(){
	return getxd_class1();
}
//获得学期
function getxq_class(){
	return getxq_class1();
}

//获得版本
function getbb_class(){
	return getbb_class1();
}

//获得主题
function getzt_class(){
	return getzt_class1();
}

//获得省份
function getsf_class(){
	return getsf_class1();
}


// 注册服务
$soap = new soap_server;
$soap->configureWSDL('xq'); // 初始化对 WSDL 的支持
//$soap->soap_defencoding = 'UTF-8'; 


//用户登录
$soap->register('login',
array("userid"=>"xsd:string","password"=>"xsd:string"), // 输入参数的定义
array("return"=>"xsd:string") // 返回参数的定义
);	
//用户注册
$soap->register('reg',
array("userid"=>"xsd:string","password"=>"xsd:string","email"=>"xsd:string"), 
array("return"=>"xsd:string") 
);	
//注册用户详细信息
$soap->register('getmeminfo',
array("userno"=>"xsd:int","password"=>"xsd:string"), 
array("return"=>"SOAP-ENC:Array")
);
//注册更新用户资料
$soap->register('memedit',
array("userno"=>"xsd:int","password"=>"xsd:string","sex"=>"xsd:int","email"=>"xsd:string","tel"=>"xsd:string","shenfen"=>"xsd:int","chengshi"=>"xsd:int","qu"=>"xsd:int","shengri"=>"xsd:bigint","aihao"=>"xsd:string","jianjie"=>"xsd:string","qianming"=>"xsd:string","nianji"=>"xsd:int","school"=>"xsd:string"),
array("return"=>"xsd:string") // 返回参数的定义
);
//修改密码
$soap->register('editpass',
array("userno"=>"xsd:int","password"=>"xsd:string","newpassword"=>"xsd:string"),
array("return"=>"xsd:string") // 返回参数的定义
);
//修改密码
$soap->register('editpic',
array("userno"=>"xsd:int","password"=>"xsd:string","pic"=>"xsd:string"),
array("return"=>"xsd:string") // 返回参数的定义
);
//注册地区
$soap->register('getareas',
array("cataid"=>"xsd:int"), 
array("return"=>"SOAP-ENC:Array")
);

//注册资源列表
$soap->register('getcontent',
array("keyword"=>"xsd:string","item"=>"xsd:string","cataid"=>"xsd:int","price_free"=>"xsd:int","nianji"=>"xsd:int","xueke"=>"xsd:int","xueduan"=>"xsd:int","xueqi"=>"xsd:int","banben"=>"xsd:int","zhuti"=>"xsd:int","shengfen"=>"xsd:int","order"=>"xsd:string","sj"=>"xsd:string","pagesize"=>"xsd:int","page"=>"xsd:int"), // 输入参数的定义
array("return"=>"SOAP-ENC:Array")// 返回参数的定义

);

//获得资源详细
$soap->register('getshow',
array("id"=>"xsd:int"), // 输入参数的定义
array("return"=>"SOAP-ENC:Array")// 返回参数的定义
);

//获得下载地址
$soap->register('getfile',
array("userno"=>"xsd:int","password"=>"xsd:string","codeid"=>"xsd:string"), // 输入参数的定义
array("return"=>"xsd:string")
);

//购买资源
$soap->register('saveorder',
array("userno"=>"xsd:int","password"=>"xsd:string","codeid"=>"xsd:string"), // 输入参数的定义
array("return"=>"xsd:string") 
);

//注册类别
$soap->register('getclass',
array("cataid"=>"xsd:int","nianji"=>"xsd:int","xueke"=>"xsd:int","xueduan"=>"xsd:int","xueqi"=>"xsd:int","banben"=>"xsd:int","zhuti"=>"xsd:int","shengfen"=>"xsd:int"),

array("return"=>"SOAP-ENC:Array") // 返回参数的定义
);
//注册年级类别
$soap->register('getnianji_class',

array("cataid"=>"xsd:int","xueke"=>"xsd:int","xueduan"=>"xsd:int","xueqi"=>"xsd:int","banben"=>"xsd:int","zhuti"=>"xsd:int","shengfen"=>"xsd:int"),
array("return"=>"SOAP-ENC:Array")
);

//注册学科类别
$soap->register('getxueke_class',
array("cataid"=>"xsd:int","nianji"=>"xsd:int","xueduan"=>"xsd:int","xueqi"=>"xsd:int","banben"=>"xsd:int","zhuti"=>"xsd:int","shengfen"=>"xsd:int"),
array("return"=>"SOAP-ENC:Array")
);
//注册学段类别
$soap->register('getxueduan_class',
array("cataid"=>"xsd:int","nianji"=>"xsd:int","xueke"=>"xsd:int","xueqi"=>"xsd:int","banben"=>"xsd:int","zhuti"=>"xsd:int","shengfen"=>"xsd:int"),
array("return"=>"SOAP-ENC:Array")
);
//注册学期类别
$soap->register('getxueqi_class',
array("cataid"=>"xsd:int","nianji"=>"xsd:int","xueke"=>"xsd:int","xueduan"=>"xsd:int","banben"=>"xsd:int","zhuti"=>"xsd:int","shengfen"=>"xsd:int"),
array("return"=>"SOAP-ENC:Array")
);
//注册版本类别
$soap->register('getbanben_class',
array("cataid"=>"xsd:int","nianji"=>"xsd:int","xueke"=>"xsd:int","xueduan"=>"xsd:int","xueqi"=>"xsd:int","zhuti"=>"xsd:int","shengfen"=>"xsd:int"),
array("return"=>"SOAP-ENC:Array")
);
//注册主题类别
$soap->register('getzhuti_class',
array("cataid"=>"xsd:int","nianji"=>"xsd:int","xueke"=>"xsd:int","xueduan"=>"xsd:int","xueqi"=>"xsd:int","banben"=>"xsd:int","shengfen"=>"xsd:int"),
array("return"=>"SOAP-ENC:Array")
);
//注册省份类别
$soap->register('getshengfen',
array("cataid"=>"xsd:int","nianji"=>"xsd:int","xueke"=>"xsd:int","xueduan"=>"xsd:int","xueqi"=>"xsd:int","banben"=>"xsd:int","zhuti"=>"xsd:int"),
array("return"=>"SOAP-ENC:Array")
);

//注册类别（不包括总数）
$soap->register('getcata',
array("cataid"=>"xsd:int"),
array("return"=>"SOAP-ENC:Array") // 返回参数的定义

);
//注册年级类别
$soap->register('getnj_class',
array(),
array("return"=>"SOAP-ENC:Array")
);

//注册学科类别
$soap->register('getxk_class',
array(),
array("return"=>"SOAP-ENC:Array")
);
//注册学段类别
$soap->register('getxd_class',
array(),
array("return"=>"SOAP-ENC:Array")
);
//注册学期类别
$soap->register('getxq_class',
array(),
array("return"=>"SOAP-ENC:Array")
);
//注册版本类别
$soap->register('getbb_class',
array(),
array("return"=>"SOAP-ENC:Array")
);
//注册主题类别
$soap->register('getzt_class',
array(),
array("return"=>"SOAP-ENC:Array")
);
//注册省份类别
$soap->register('getsf_class',
array(),
array("return"=>"SOAP-ENC:Array")
);

$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$soap->service($HTTP_RAW_POST_DATA);


?>